
#include "iostream"
#include "vector"
#include "unordered_map"
#include "unordered_set"
#include "algorithm"
#include "string"
#include "list"
#include "string.h"

class OneLoop{
public:
    void swap_if_a_dayu_b(double &a,double &b){
        if(a>b){
            std::swap(a,b);
        }
    }
    double get_xiangjiao(double x1,double x2,double x3,double x4){
        if(x4<x2){
            std::swap(x1,x3);
            std::swap(x2,x4);
        }

        double max_left= std::max(x1,x3);
        double min_right= std::min(x2,x4);
        if(max_left>=min_right){
            return 0;
        } else{
            return min_right-max_left;
        }
    }
    void run(double n){
        double x1,y1,x2,y2;
        double x3,y3,x4,y4;
        x1=n;std::cin>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        swap_if_a_dayu_b(x1,x2);
        swap_if_a_dayu_b(y1,y2);
        swap_if_a_dayu_b(x3,x4);
        swap_if_a_dayu_b(y3,y4);
        double dx= get_xiangjiao(x1,x2,x3,x4);
        double dy= get_xiangjiao(y1,y2,y3,y4);
        printf("%.2f",dx*dy);
    }
};
class Solution {
public:
    void run() {

        bool first = true;
        double a,b,c,d,e;

        while (std::cin>>a)
        {
            OneLoop loop;
            loop.run(a);
        }
    }
};

int main() {
//    bool cur_num= true;
    Solution().run();
    return 0;
}

